//== SAGITTARIUS ============================================================================

//== BEGINNING OF CODE ===============================================================

#ifndef __SAGUTTARUIS__SYSALLOC__H_
#define __SAGUTTARUIS__SYSALLOC__H_

//== INCLUDES ========================================================================

#include "sagittarius/core/SagittariusCore.h"
#include <stddef.h>


#if SAGITTARIUS_PLATFORM == SAGITTARIUS_PLATFORM_LINUX
    #define SG_PAGE_SIZE 4096
    //syscalls: mmap, munmap
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    void* sg_sysalloc(size_t n_pgs);
    int sg_sysfree(void* p, size_t n_pgs);
    
    #ifdef __cplusplus
    }//extern "C"
    #endif
#elif SAGITTARIUS_PLATFORM == SAGITTARIUS_PLATFORM_WIN
    #define SG_PAGE_SIZE 4096
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    void* sg_sysalloc(size_t n_pgs);
    int sg_sysfree(void* p, size_t n_pgs);
    
    #ifdef __cplusplus
    }//extern "C"
    #endif
#else
#error "No platform"
#endif


#endif
